package com.class05._super;

/**
 * @ClassDescription:
 * @JdkVersion: 17
 * @Author: yxy
 * @Created: 2024/4/8 16:34
 */
public class Person {
    //    属性
    String name;
    private int age;
    int id = 1001;//身份证号

    public Person() {
        System.out.println("Person()....");
    }

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Person(String name, int age, int id) {
        this.name = name;
        this.age = age;
        this.id = id;
    }

    //    方法
    public void eat(double money) {

        System.out.println("人吃了" + money + "钱的饭");
    }

    public void sleep() {
        System.out.println("人睡觉");
    }

    public void doSport() {
        System.out.println("人运动");
    }


    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String setAge() {
        this.age = age;
        return "设置成功了";
    }


}
